package products;

enum State{NEW,LOADED,CHANGED};

public class Product 
{
	private String name;
	private String description;
	private double cost;
	private State state=State.NEW;
	
	
	public Product(String name, String description, double cost) 
	{
		
		this.name = name;
		this.description = description;
		this.cost = cost;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public double getCost() {
		return cost;
	}

	public void setCost(double cost) {
		this.cost = cost;
	}

	
	public State getState() {
		return state;
	}


	public String toString() 
	{
		return "Name:" + name + "\n" + "Description:" + description
				+"\n"+ "Cost:" + cost+"\n"+"State:"+state;
	}
	
	
	public ProductMemento memento ()
	{
		return new ProductMemento(name, description, cost, state);
	}//va permite copierea starii obiectului curent intr-un obiect de tip MementoProduct
	
	public void restoreMemento (ProductMemento memento)
	{
		this.name=memento.getName();
		///continuare punctul 8 din lab4.pdf  (ex1)
	}

}
